Integrand size = 43, antiderivative size = 635 \[ \int (a g+b g x) (c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\frac {B^2 (b c-a d)^3 g i^2 n^2 x}{12 b^2 d}+\frac {B^2 (b c-a d)^2 g i^2 n^2 (c+d x)^2}{12 b d^2}-\frac {B (b c-a d)^3 g i^2 n (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 b^3 d}-\frac {B (b c-a d)^2 g i^2 n (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 b^3}+\frac {B (b c-a d)^2 g i^2 n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{4 b d^2}-\frac {B (b c-a d) g i^2 n (c+d x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 d^2}+\frac {(b c-a d)^2 g i^2 (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{12 b^3}+\frac {(b c-a d) g i^2 (a+b x)^2 (c+d x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{6 b^2}+\frac {g i^2 (a+b x)^2 (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{4 b}-\frac {B (b c-a d)^4 g i^2 n \left (A+B n+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log \left (\frac {b c-a d}{b (c+d x)}\right )}{6 b^3 d^2}-\frac {B^2 (b c-a d)^4 g i^2 n^2 \log \left (\frac {a+b x}{c+d x}\right )}{12 b^3 d^2}-\frac {B^2 (b c-a d)^4 g i^2 n^2 \log (c+d x)}{4 b^3 d^2}-\frac {B^2 (b c-a d)^4 g i^2 n^2 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{b (c+d x)}\right )}{6 b^3 d^2} \]
[Out]
Time = 0.43 (sec) , antiderivative size = 635, normalized size of antiderivative = 1.00, number of steps used = 14, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.256, Rules used = {2561, 2383, 2381, 2384, 2354, 2438, 2373, 45, 2382, 12, 78} \[ \int (a g+b g x) (c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=-\frac {B g i^2 n (b c-a d)^4 \log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A+B n\right )}{6 b^3 d^2}-\frac {B g i^2 n (a+b x) (b c-a d)^3 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{6 b^3 d}+\frac {g i^2 (a+b x)^2 (b c-a d)^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{12 b^3}-\frac {B g i^2 n (a+b x)^2 (b c-a d)^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{6 b^3}+\frac {g i^2 (a+b x)^2 (c+d x) (b c-a d) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{6 b^2}+\frac {B g i^2 n (c+d x)^2 (b c-a d)^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{4 b d^2}-\frac {B g i^2 n (c+d x)^3 (b c-a d) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{6 d^2}+\frac {g i^2 (a+b x)^2 (c+d x)^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{4 b}-\frac {B^2 g i^2 n^2 (b c-a d)^4 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{b (c+d x)}\right )}{6 b^3 d^2}-\frac {B^2 g i^2 n^2 (b c-a d)^4 \log \left (\frac {a+b x}{c+d x}\right )}{12 b^3 d^2}-\frac {B^2 g i^2 n^2 (b c-a d)^4 \log (c+d x)}{4 b^3 d^2}+\frac {B^2 g i^2 n^2 x (b c-a d)^3}{12 b^2 d}+\frac {B^2 g i^2 n^2 (c+d x)^2 (b c-a d)^2}{12 b d^2} \]
[In]
[Out]
Rule 12
Rule 45
Rule 78
Rule 2354
Rule 2373
Rule 2381
Rule 2382
Rule 2383
Rule 2384
Rule 2438
Rule 2561
Rubi steps \begin{align*} \text {integral}& = \left ((b c-a d)^4 g i^2\right ) \text {Subst}\left (\int \frac {x \left (A+B \log \left (e x^n\right )\right )^2}{(b-d x)^5} \, dx,x,\frac {a+b x}{c+d x}\right ) \\ & = \frac {g i^2 (a+b x)^2 (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{4 b}+\frac {\left ((b c-a d)^4 g i^2\right ) \text {Subst}\left (\int \frac {x \left (A+B \log \left (e x^n\right )\right )^2}{(b-d x)^4} \, dx,x,\frac {a+b x}{c+d x}\right )}{2 b}-\frac {\left (B (b c-a d)^4 g i^2 n\right ) \text {Subst}\left (\int \frac {x \left (A+B \log \left (e x^n\right )\right )}{(b-d x)^4} \, dx,x,\frac {a+b x}{c+d x}\right )}{2 b} \\ & = \frac {B (b c-a d)^2 g i^2 n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{4 b d^2}-\frac {B (b c-a d) g i^2 n (c+d x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 d^2}+\frac {(b c-a d) g i^2 (a+b x)^2 (c+d x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{6 b^2}+\frac {g i^2 (a+b x)^2 (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{4 b}+\frac {\left ((b c-a d)^4 g i^2\right ) \text {Subst}\left (\int \frac {x \left (A+B \log \left (e x^n\right )\right )^2}{(b-d x)^3} \, dx,x,\frac {a+b x}{c+d x}\right )}{6 b^2}-\frac {\left (B (b c-a d)^4 g i^2 n\right ) \text {Subst}\left (\int \frac {x \left (A+B \log \left (e x^n\right )\right )}{(b-d x)^3} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 b^2}+\frac {\left (B^2 (b c-a d)^4 g i^2 n^2\right ) \text {Subst}\left (\int \frac {-b+3 d x}{6 d^2 x (b-d x)^3} \, dx,x,\frac {a+b x}{c+d x}\right )}{2 b} \\ & = -\frac {B (b c-a d)^2 g i^2 n (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 b^3}+\frac {B (b c-a d)^2 g i^2 n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{4 b d^2}-\frac {B (b c-a d) g i^2 n (c+d x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 d^2}+\frac {(b c-a d)^2 g i^2 (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{12 b^3}+\frac {(b c-a d) g i^2 (a+b x)^2 (c+d x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{6 b^2}+\frac {g i^2 (a+b x)^2 (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{4 b}-\frac {\left (B (b c-a d)^4 g i^2 n\right ) \text {Subst}\left (\int \frac {x \left (A+B \log \left (e x^n\right )\right )}{(b-d x)^2} \, dx,x,\frac {a+b x}{c+d x}\right )}{6 b^3}+\frac {\left (B^2 (b c-a d)^4 g i^2 n^2\right ) \text {Subst}\left (\int \frac {x}{(b-d x)^2} \, dx,x,\frac {a+b x}{c+d x}\right )}{6 b^3}+\frac {\left (B^2 (b c-a d)^4 g i^2 n^2\right ) \text {Subst}\left (\int \frac {-b+3 d x}{x (b-d x)^3} \, dx,x,\frac {a+b x}{c+d x}\right )}{12 b d^2} \\ & = -\frac {B (b c-a d)^3 g i^2 n (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 b^3 d}-\frac {B (b c-a d)^2 g i^2 n (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 b^3}+\frac {B (b c-a d)^2 g i^2 n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{4 b d^2}-\frac {B (b c-a d) g i^2 n (c+d x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 d^2}+\frac {(b c-a d)^2 g i^2 (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{12 b^3}+\frac {(b c-a d) g i^2 (a+b x)^2 (c+d x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{6 b^2}+\frac {g i^2 (a+b x)^2 (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{4 b}+\frac {\left (B (b c-a d)^4 g i^2 n\right ) \text {Subst}\left (\int \frac {A+B n+B \log \left (e x^n\right )}{b-d x} \, dx,x,\frac {a+b x}{c+d x}\right )}{6 b^3 d}+\frac {\left (B^2 (b c-a d)^4 g i^2 n^2\right ) \text {Subst}\left (\int \left (\frac {b}{d (-b+d x)^2}+\frac {1}{d (-b+d x)}\right ) \, dx,x,\frac {a+b x}{c+d x}\right )}{6 b^3}+\frac {\left (B^2 (b c-a d)^4 g i^2 n^2\right ) \text {Subst}\left (\int \left (-\frac {1}{b^2 x}+\frac {2 d}{(b-d x)^3}-\frac {d}{b (b-d x)^2}-\frac {d}{b^2 (b-d x)}\right ) \, dx,x,\frac {a+b x}{c+d x}\right )}{12 b d^2} \\ & = \frac {B^2 (b c-a d)^3 g i^2 n^2 x}{12 b^2 d}+\frac {B^2 (b c-a d)^2 g i^2 n^2 (c+d x)^2}{12 b d^2}-\frac {B (b c-a d)^3 g i^2 n (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 b^3 d}-\frac {B (b c-a d)^2 g i^2 n (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 b^3}+\frac {B (b c-a d)^2 g i^2 n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{4 b d^2}-\frac {B (b c-a d) g i^2 n (c+d x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 d^2}+\frac {(b c-a d)^2 g i^2 (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{12 b^3}+\frac {(b c-a d) g i^2 (a+b x)^2 (c+d x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{6 b^2}+\frac {g i^2 (a+b x)^2 (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{4 b}-\frac {B (b c-a d)^4 g i^2 n \left (A+B n+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log \left (\frac {b c-a d}{b (c+d x)}\right )}{6 b^3 d^2}-\frac {B^2 (b c-a d)^4 g i^2 n^2 \log \left (\frac {a+b x}{c+d x}\right )}{12 b^3 d^2}-\frac {B^2 (b c-a d)^4 g i^2 n^2 \log (c+d x)}{4 b^3 d^2}+\frac {\left (B^2 (b c-a d)^4 g i^2 n^2\right ) \text {Subst}\left (\int \frac {\log \left (1-\frac {d x}{b}\right )}{x} \, dx,x,\frac {a+b x}{c+d x}\right )}{6 b^3 d^2} \\ & = \frac {B^2 (b c-a d)^3 g i^2 n^2 x}{12 b^2 d}+\frac {B^2 (b c-a d)^2 g i^2 n^2 (c+d x)^2}{12 b d^2}-\frac {B (b c-a d)^3 g i^2 n (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 b^3 d}-\frac {B (b c-a d)^2 g i^2 n (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 b^3}+\frac {B (b c-a d)^2 g i^2 n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{4 b d^2}-\frac {B (b c-a d) g i^2 n (c+d x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{6 d^2}+\frac {(b c-a d)^2 g i^2 (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{12 b^3}+\frac {(b c-a d) g i^2 (a+b x)^2 (c+d x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{6 b^2}+\frac {g i^2 (a+b x)^2 (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{4 b}-\frac {B (b c-a d)^4 g i^2 n \left (A+B n+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log \left (\frac {b c-a d}{b (c+d x)}\right )}{6 b^3 d^2}-\frac {B^2 (b c-a d)^4 g i^2 n^2 \log \left (\frac {a+b x}{c+d x}\right )}{12 b^3 d^2}-\frac {B^2 (b c-a d)^4 g i^2 n^2 \log (c+d x)}{4 b^3 d^2}-\frac {B^2 (b c-a d)^4 g i^2 n^2 \text {Li}_2\left (\frac {d (a+b x)}{b (c+d x)}\right )}{6 b^3 d^2} \\ \end{align*}
Time = 0.36 (sec) , antiderivative size = 713, normalized size of antiderivative = 1.12 \[ \int (a g+b g x) (c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\frac {g i^2 \left (-4 (b c-a d) (c+d x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2+3 b (c+d x)^4 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2+\frac {4 B (b c-a d)^2 n \left (2 A b d (b c-a d) x-B (b c-a d) n (b d x+(b c-a d) \log (a+b x))+2 B d (b c-a d) (a+b x) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+b^2 (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+2 (b c-a d)^2 \log (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )-2 B (b c-a d)^2 n \log (c+d x)-B (b c-a d)^2 n \left (\log (a+b x) \left (\log (a+b x)-2 \log \left (\frac {b (c+d x)}{b c-a d}\right )\right )-2 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{-b c+a d}\right )\right )\right )}{b^3}-\frac {B (b c-a d) n \left (6 A b d (b c-a d)^2 x-3 B (b c-a d)^2 n (b d x+(b c-a d) \log (a+b x))-B (b c-a d) n \left (2 b d (b c-a d) x+b^2 (c+d x)^2+2 (b c-a d)^2 \log (a+b x)\right )+6 B d (b c-a d)^2 (a+b x) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+3 b^2 (b c-a d) (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+2 b^3 (c+d x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+6 (b c-a d)^3 \log (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )-6 B (b c-a d)^3 n \log (c+d x)-3 B (b c-a d)^3 n \left (\log (a+b x) \left (\log (a+b x)-2 \log \left (\frac {b (c+d x)}{b c-a d}\right )\right )-2 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{-b c+a d}\right )\right )\right )}{b^3}\right )}{12 d^2} \]
[In]
[Out]
\[\int \left (b g x +a g \right ) \left (d i x +c i \right )^{2} {\left (A +B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )\right )}^{2}d x\]
[In]
[Out]
\[ \int (a g+b g x) (c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\int { {\left (b g x + a g\right )} {\left (d i x + c i\right )}^{2} {\left (B \log \left (e \left (\frac {b x + a}{d x + c}\right )^{n}\right ) + A\right )}^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int (a g+b g x) (c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\text {Timed out} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 2662 vs. \(2 (608) = 1216\).
Time = 0.74 (sec) , antiderivative size = 2662, normalized size of antiderivative = 4.19 \[ \int (a g+b g x) (c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int (a g+b g x) (c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\int { {\left (b g x + a g\right )} {\left (d i x + c i\right )}^{2} {\left (B \log \left (e \left (\frac {b x + a}{d x + c}\right )^{n}\right ) + A\right )}^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int (a g+b g x) (c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2 \, dx=\int \left (a\,g+b\,g\,x\right )\,{\left (c\,i+d\,i\,x\right )}^2\,{\left (A+B\,\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )\right )}^2 \,d x \]
[In]
[Out]